import { fetchLogin } from '@/service/login';
import { IRouteComponentProps, useLocation } from 'umi';
import { Button } from 'antd';
import { FC, PropsWithChildren } from 'react';
import { history } from 'umi';

const LoginIndex = (
  props: IRouteComponentProps<any, Record<string, string>>,
) => {
  const handleLogin = async () => {
    const res = await fetchLogin();

    if (res.data.code === 0) {
      // console.log(res,redirectUrl)
      //   window.location.replace('/#'+redirectUrl)
      history.goBack();
    }
  };
  return (
    <div>
      <Button onClick={() => handleLogin()}>登录</Button>
    </div>
  );
};

export default LoginIndex;
